package com.motong.gongdan.vo.H5Vo.lamp.vo;

import com.motong.gongdan.entity.LampRequestDetail;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Data
@Accessors(chain = true)
public class LampListVo {
    /**
     * 联络灯请求id
     */
    @ApiModelProperty(value = "联络灯请求id")
    private Long id;

    /**
     * 联络灯类型(lamp_type表id)
     */
    @ApiModelProperty(value = "联络灯类型(lamp_type表id)")
    private Long type;

    /**
     * 联络灯类型颜色
     */
    @ApiModelProperty(value = "联络灯类型颜色")
    private String typeColor;

    /**
     * 类型名称
     */
    @ApiModelProperty(value = "类型名称")
    private String typeName;

    /**
     * 设备id
     */
    @ApiModelProperty(value = "设备id")
    private Long deviceId;

    /**
     * 设备分组id
     */
    @ApiModelProperty(value = "设备分组id")
    private Long groupId;

    /**
     * 处理状态(0 等待响应, 1 请求中, 2 已关闭)
     */
    @ApiModelProperty(value = "处理状态(0 等待响应, 1 请求中, 2 已关闭)")
    private Integer dealState;

    /**
     * 处理状态名称
     */
    @ApiModelProperty(value = "处理状态名称")
    private String dealStateName;

    /**
     * 处理人(user表id)
     */
    @ApiModelProperty(value = "处理人(user表id)")
    private String dealUser;

    /**
     * 处理人名称
     */
    @ApiModelProperty(value = "处理人名称")
    private String dealUserName;


    /**
     * 响应时间
     */
    @ApiModelProperty(value = "响应时间")
    private Date responseTime;

    /**
     * 创建人
     */
    @ApiModelProperty(value = "创建人")
    private Integer createUser;

    /**
     * 请求人名称
     */
    @ApiModelProperty(value = "请求人名称")
    private String createUserName;

    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    private String remark;

    /**
     * 补充说明
     */
    @ApiModelProperty(value = "补充说明")
    private String note;

    /**
     * 补充说明图片
     */
    @ApiModelProperty(value = "补充说明图片")
    private String noteImg;


    /**
     * 处理结果备注
     */
    @ApiModelProperty(value = "处理结果")
    private String result;

    /**
     * 处理结果图片
     */
    @ApiModelProperty(value = "处理结果图片")
    private String resultImg;

    /**
     * 完成时间
     */
    @ApiModelProperty(value = "完成时间")
    private Date finishTime;


    /**
     * 响应时长(分钟)
     */
    @ApiModelProperty(value = "响应时长(分钟)")
    private BigDecimal responseInterval;

    /**
     * 响应时长(天/小时)
     */
    @ApiModelProperty(value = "响应时长(天/小时)")
    private String responseIntervalCn;

    /**
     * 处理时长(分钟)
     */
    @ApiModelProperty(value = "处理时长(分钟)")
    private BigDecimal dealInterval;

    /**
     * 处理时长(天/小时)
     */
    @ApiModelProperty(value = "处理时长(天/小时)")
    private String dealIntervalCn;

    /**
     * 总时长
     */
    @ApiModelProperty(value = "总时长(分钟)")
    private BigDecimal totalInterval;

    /**
     * 总时长
     */
    @ApiModelProperty(value = "总时长(小时)")
    private BigDecimal totalIntervalHour;

    /**
     * 总时长(天/小时)
     */
    @ApiModelProperty(value = "总时长(天/小时)")
    private String totalIntervalCn;

    /**
     * 持续时长(天/小时....)
     */
    @ApiModelProperty(value = "持续时长(天/小时)")
    private String lastIntervalCn;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    /**
     * 设备名称
     */
    @ApiModelProperty(value = "设备名称")
    private String deviceName;

    /**
     * 设备编号
     */
    @ApiModelProperty(value = "设备编号")
    private String deviceSn;


    /**
     * 回复详情
     */
    @ApiModelProperty(value = "回复详情")
    private List<LampRequestDetail> lampRequestDetails;


    /**
     * 设备分组名称
     */
    @ApiModelProperty(value = "设备分组名称")
    private String deviceGroupName;

    /**
     * 联络灯明细(固定名称)
     */
    @ApiModelProperty(value = "联络灯明细(固定名称)")
    private String lampLog = "联络灯明细";


    public LampListVo setDealState(Integer dealState) {
        switch (dealState) {
            case 0:
                this.dealStateName = "等待响应";
                break;
            case 1:
                this.dealStateName = "处理中";
                break;
            case 2:
                this.dealStateName = "已关闭";
                break;
        }
        this.dealState = dealState;
        return this;
    }
}
